/**
 * $Id: GdNode.java,v 1.1 2010-08-25 08:36:59 gaudenz Exp $
 * Copyright (c) 2010, Gaudenz Alder, David Benson
 */
package com.kg.rails.component.editor.io.gd;

import com.kg.rails.component.editor.util.EditorPoint;

/**
 * Represents a Node entry in the file.
 */
public class GdNode {
    /**
     * Name of the node.
     */
    private String name;

    /**
     * Coordinates (x,y) of the Node.
     */
    private EditorPoint coordinates;

    /**
     * Dimensions (width, height) of the Node.
     */
    private EditorPoint dimentions;

    public GdNode(String name, EditorPoint coordinates, EditorPoint dimentions) {
        this.name = name;
        this.coordinates = coordinates;
        this.dimentions = dimentions;
    }

    public EditorPoint getCoordinates() {
        return coordinates;
    }

    public void setCoordinates(EditorPoint coordinates) {
        this.coordinates = coordinates;
    }

    public EditorPoint getDimentions() {
        return dimentions;
    }

    public void setDimentions(EditorPoint dimentions) {
        this.dimentions = dimentions;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNodeString() {
        return name + "," + (int) coordinates.getX() + ","
                + (int) coordinates.getY() + "," + (int) dimentions.getX()
                + "," + (int) dimentions.getY();

    }
}
